package net.hvacapp.cmvrfforandroid.ui.more;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.ViewConfiguration;

import net.hvacapp.cmvrfforandroid.R;
import net.hvacapp.cmvrfforandroid.ui.BaseSwipeBackActivity;
import net.hvacapp.cmvrfforandroid.widget.CMActionBar;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;

import java.lang.reflect.Field;

@EActivity(R.layout.activity_about)
public class AboutActivity extends BaseSwipeBackActivity {

    /**
     * 页面加载完后执行
     */
    @AfterViews
    @Override
    protected void viewDidLoad() {
    }

    /**
     * 初始化
     */
    @Override
    public void initBoot() {
    }

    /**
     * 初始化数据
     */
    @Override
    public void initData(Intent intent) {
    }

    /**
     * 页面名称
     */
    @Override
    public String getName() {
        return "";
    }

//    private void initActionBar(){
//        getCMActionBar().setTitle("关于我们");
//        getCMActionBar().setLeftAction(new CMActionBar.Action() {
//            @Override
//            public int getDrawable() {
//                return R.drawable.ic_action_back;
//            }
//
//            @Override
//            public void performAction() {
//                finish();
//            }
//        });
//    }

    private void getOverflowMenu() {

        try {
            ViewConfiguration config = ViewConfiguration.get(this);
            Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
            if(menuKeyField != null) {
                menuKeyField.setAccessible(true);
                menuKeyField.setBoolean(config, false);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

//    @Override
//    public boolean onCreateOptionsMenu(Menu menu) {
//        // Inflate the menu; this adds items to the action bar if it is present.
//        getMenuInflater().inflate(R.menu.menu_about, menu);
//        return true;
//    }
//
//    @Override
//    public boolean onOptionsItemSelected(MenuItem item) {
//        // Handle action bar item clicks here. The action bar will
//        // automatically handle clicks on the Home/Up button, so long
//        // as you specify a parent activity in AndroidManifest.xml.
//        int id = item.getItemId();
//
//        //noinspection SimplifiableIfStatement
//        if (id == R.id.action_settings) {
//            return true;
//        }
//
//        return super.onOptionsItemSelected(item);
//    }
}
